//
//  TXYRespErrorParse.h
//  FunnyVideo
//
//  Created by 李鑫 on 15/8/28.
//  Copyright © 2015年 NewEggTech. All rights reserved.
//

//proxy 逻辑错误码

#define _ERROR_PROXY_AUTH_FAILED        -97
#define _ERROR_PROXY_AUTH_FAILED_MSG    "非法签名"

#define _ERROR_PROXY_AUTH_EXPIRED       -96
#define _ERROR_PROXY_AUTH_EXPIRED_MSG   "签名过期"

#define _ERROR_PROXY_AUTH_APPID_NOEXIST -82
#define _ERROR_PROXY_AUTH_APPID_NOEXIST_MSG "不存在此appid"

#define _ERROR_PROXY_AUTH_SIGN_EMPTY    -81
#define _ERROR_PROXY_AUTH_SIGN_EMPTY_MSG "签名为空"

#define _ERROR_PROXY_INVALID_APPID		-80
#define	_ERROR_PROXY_INVALID_APPID_MSG  "非法的业务ID"

#define _ERROR_PROXY_AUTH_SECRETID_NOEXIST -79
#define _ERROR_PROXY_AUTH_SECRETID_NOEXIST_MSG "secret id不存在"

#define _ERROR_PROXY_AUTH_REPLAY_ATTACH -77
#define _ERROR_PROXY_AUTH_REPLAY_ATTACH_MSG "单次性签名已不可用"

#define _ERROR_PROXY_AUTH_ONCESIGN_NOFILEID -76
#define _ERROR_PROXY_AUTH_ONCESIGN_NOFILEID_MSG "单次签名没有url"

#define _ERROR_PROXY_AUTH_MULTISIGN_EXPIREDEMPTY -74
#define _ERROR_PROXY_AUTH_MULTISIGN_EXPIREDEMPTY_MSG "多次签名-过期时间为0"

#define _ERROR_PROXY_AUTH_ONCESIGN_EXPIREDNOTEMPTY -73
#define _ERROR_PROXY_AUTH_ONCESIGN_EXPIREDNOTEMPTY_MSG "单次签名-过期时间不为0"

#define _ERROR_PROXY_APPID_USERID_NOTMATCH -70
#define _ERROR_PROXY_APPID_USERID_NOTMATCH_MSG "appid/userid 与签名不匹配"

#define _ERROR_PROXY_INVALID_PARAM_DOWNLOAD_URL_EMPTY -69
#define _ERROR_PROXY_INVALID_PARAM_DOWNLOAD_URL_EMPTY_MSG  "输入参数错误:download_url empty"

#define _ERROR_PROXY_FORBID_APPID       -64
#define _ERROR_PROXY_FORBID_APPID_MSG   "该业务已经被屏蔽"

#define _ERROR_PROXY_FILEID_NOTMATCH  	     -63
#define _ERROR_PROXY_FILEID_NOTMATCH_MSG "fileid 与签名不匹配"

#define _ERROR_PROXY_AUTH_APPID             -62
#define _ERROR_PROXY_AUTH_APPID_MSG  		"appid与secretid不匹配"

#define _ERROR_PROXY_SIGN_BUCKET_NOTMATCH         -61
#define _ERROR_PROXY_SIGN_BUCKET_NOTMATCH_MSG     "bucket与签名中的bucket不匹配"

#define _ERROR_PROXY_AUTH_INVALID_TOKEN         -60
#define _ERROR_PROXY_AUTH_INVALID_TOKEN_MSG     "非法token值"



//CMD 逻辑错误码

#define _ERROR_CMD_FILE_NOTEXIST		-197
#define _ERROR_CMD_FILE_NOTEXIST_MSG	"查无此文件"

#define _ERROR_CMD_URL_PARAMS_NOTMATCH  -191
#define _ERROR_CMD_URL_PARAMS_NOTMATCH_MSG "url参数解析不匹配"

#define _ERROR_CMD_INVALID_PARAM_DOWNLOAD_URL_EMPTY -189
#define _ERROR_CMD_INVALID_PARAM_DOWNLOAD_URL_EMPTY_MSG  "输入参数错误:download_url empty"

#define _ERROR_CMD_URL_PARSE_ERROR 		-187
#define _ERROR_CMD_URL_PARSE_ERROR_MSG  "从url中解析参数失败"

#define _ERROR_CMD_PARAM_INVALID        -182
#define _ERROR_CMD_PARAM_INVALID_MSG    "参数检验失败"

#define _ERROR_CMD_COS_INVALID_PATH      -180
#define _ERROR_CMD_COS_INVALID_PATH_MSG  "非法路径"

#define _ERROR_CMD_COS_INVALID_MOD_FLAG      -179
#define _ERROR_CMD_COS_INVALID_MOD_FLAG_MSG  "修改标志非法"

#define _ERROR_CMD_COS_PATH_CONFLICT         -178
#define _ERROR_CMD_COS_PATH_CONFLICT_MSG     "路径冲突"

#define _ERROR_CMD_COS_FILE_EXIST            -177
#define _ERROR_CMD_COS_FILE_EXIST_MSG        "文件已存在"

#define _ERROR_CMD_COS_BUCKET_EXIST          -176
#define _ERROR_CMD_COS_BUCKET_EXIST_MSG      "Bucket已存在"

#define _ERROR_CMD_COS_FILE_SIZE_NOT_EQU      -175
#define _ERROR_CMD_COS_FILE_SIZE_NOT_EQU_MSG  "文件大小不一致"

#define _ERROR_CMD_COS_SHA_NOT_EQU            -174
#define _ERROR_CMD_COS_SHA_NOT_EQU_MSG        "文件SHA不一致"

#define _ERROR_CMD_COS_DIR_NOT_EMPTY          -173
#define _ERROR_CMD_COS_DIR_NOT_EMPTY_MSG      "目录非空"

#define _ERROR_CMD_COS_BUCKET_NUM_LIMIT       -172
#define _ERROR_CMD_COS_BUCKET_NUM_LIMIT_MSG   "Bucket数量限制"

#define _ERROR_CMD_COS_INVALID_APP_TYPE       -171
#define _ERROR_CMD_COS_INVALID_APP_TYPE_MSG   "AppType非法"

#define _ERROR_CMD_COS_INVALID_LIST_NUM       -170
#define _ERROR_CMD_COS_INVALID_LIST_NUM_MSG   "LIST数量非法"

#define _ERROR_CMD_COS_INVALID_QUERY_FLAG     -169
#define _ERROR_CMD_COS_INVALID_QUERY_FLAG_MSG "查询标记非法"

#define _ERROR_CMD_COS_INVALID_SHA            -168
#define _ERROR_CMD_COS_INVALID_SHA_MSG        "非法SHA"

#define _ERROR_CMD_COS_INVALID_CNAME          -167
#define _ERROR_CMD_COS_INVALID_CNAME_MSG      "非法的CNAME"

#define _ERROR_CMD_COS_INDEX_ERROR            -166
#define _ERROR_CMD_COS_INDEX_ERROR_MSG        "索引不存在"

#define _ERROR_CMD_COS_MAX_NUM                -165
#define _ERROR_CMD_COS_MAX_NUM_MSG	          "单次拉取目录最大支持199"

#define _ERROR_CMD_PARAM_PATH_EMPTY           -164
#define _ERROR_CMD_PARAM_PATH_EMPTY_MSG       "path为空"

#define _ERROR_CMD_PARAM_PATH_ELEMENT_MISSING       -163
#define _ERROR_CMD_PARAM_PATH_ELEMENT_MISSING_MSG   "path字段缺少元素"

#define _ERROR_CMD_PARAM_PATH_ELEMENT_NOT_MATCH         -162
#define _ERROR_CMD_PARAM_PATH_ELEMENT_NOT_MATCH_MSG     "path字段元素不匹配"

#define _ERROR_CMD_PARAM_PATH_DIR_MISSING_SLASH         -161
#define _ERROR_CMD_PARAM_PATH_DIR_MISSING_SLASH_MSG     "目录path字段缺少slash结尾"

#define _ERROR_CMD_PARAM_PAHT_FILE_SURPLUS_SLASH        -160
#define _ERROR_CMD_PARAM_PAHT_FILE_SURPLUS_SLASH_MSG    "文件path多余slash结尾"

#define _ERROR_CMD_PARAM_CNAME_ERROR           -159
#define _ERROR_CMD_PARAM_CNAME_ERROR_MSG       "cname错误"                //BucketCreateReq中的cname错误

#define _ERROR_CMD_PARAM_AUTH_TYPE             -158
#define _ERROR_CMD_PARAM_AUTH_TYPE_MSG         "鉴权类别错误"                                    // 鉴权类别错误

#define _ERROR_CMD_PARAM_MIN_NUM               -157
#define _ERROR_CMD_PARAM_MIN_NUM_MSG           "单次拉取条目最小为1"                 //  DirListReq中拉取数据条数

#define _ERROR_CMD_INVALID_VIDEO_NAME          -156
#define _ERROR_CMD_INVALID_VIDEO_NAME_MSG      "非法的视频名"

#define _ERROR_CMD_INVALID_FORMAT              -155
#define _ERROR_CMD_INVALID_FORMAT_MSG          "非法视频FORMAT"

#define _ERR_CMD_APP_VIDEO_NOMATCH             -154
#define _ERR_CMD_APP_VIDEO_NOMATCH_MSG         "文件BUCKET中设置视频参数"

#define _ERR_CMD_INVALID_VIDEO_APP             -153
#define _ERR_CMD_INVALID_VIDEO_APP_MSG         "非法的视频APP"


//Process 逻辑错误码

#define _ERROR_PROCESS_UNKNOWN_CMD		-299
#define _ERROR_PROCESS_UNKNOWN_CMD_MSG	"命令字未知"

#define _ERROR_PROCESS_FILE_TOO_LARGE	-285
#define _ERROR_PROCESS_FILE_TOO_LARGE_MSG	"文件过大"

#define _ERROR_PROCESS_ANALYZE			-282
#define _ERROR_PROCESS_ANALYZE_MSG		"图片分析失败"

#define _ERROR_PHOTO_EXIST_FILEID		-1886
#define _ERROR_PHOTO_EXIST_FILEID_MSG   "图片fileid已经存在"

#define _ERROR_PHOTO_INVALID_FILEID		-1885
#define _ERROR_PHOTO_INVALID_FILEID_MSG "fileid含有异常字符"

#define _ERROR_PHOTO_CALLBACK_APP		-1884
#define _ERROR_PHOTO_CALLBACK_APP_MSG   "APP回调不通过"

#define _ErrInputParaError -3101
#define _ErrInputParaError_MSG "输入参数错误"

#define _ErrParamInvalid        -4002
#define _ErrParamInvalid_MSG    "请求参数错误"

#define _ErrTheSameOffset                 -4015
#define _ErrTheSameOffset_MSG             "同一个offset多次返回"

#define _ErrSameFileUpload                -4018
#define _ErrSameFileUpload_MSG            "相同文件已上传过"

#define  _ErrParamInvalidCheckTypeShouldBeSHA   -4020
#define  _ErrParamInvalidCheckTypeShouldBeSHA_MSG  "校验类型需要SHA"

#define _ErrParamInvalidSessionDecodeError	-4021
#define _ErrParamInvalidSessionDecodeError_MSG  "参数session解码失败"

#define _ErrParamInvalidFilePathInvalid	-4022
#define _ErrParamInvalidFilePathInvalid_MSG	"获取bucket路径失败"

#define _ErrParamInvalidCheckSumSizeInvalid 	-4023
#define _ErrParamInvalidCheckSumSizeInvalid_MSG 	"校验和大小错误"


//CGI逻辑错误码

#define _ERROR_CGI_PARAM 	 			-5999
#define _ERROR_CGI_PARAM_MSG 			"参数错误"

#define _ERROR_CGI_AUTHORIZATION		-5998
#define _ERROR_CGI_AUTHORIZATION_MSG	"签名格式错误"

#define _ERROR_CGI_REQ_METHOD   		-5996
#define _ERROR_CGI_REQ_METHOD_MSG 		"HTTP请求方法错误"

#define _ERROR_CGI_FILESIZE  			-5995
#define _ERROR_CGI_FILESIZE_MSG 		"文件大小错误"

#define _ERROR_CGI_URL_NOTMATCH 		-5994
#define _ERROR_CGI_URL_NOTMATCH_MSG 	"url参数解析不匹配'"

#define _ERROR_CGI_FORM_ERR 			-5993
#define _ERROR_CGI_FORM_ERR_MSG 		"multipart/formdata参数错误"

#define _ERROR_CGI_REQ_PARAM 			-5992
#define _ERROR_CGI_REQ_PARAM_MSG 		"请求参数错误"

#define _ERROR_CGI_SLICE 				-5991
#define _ERROR_CGI_SLICE_MSG 			"分片过大"

#define _ERROR_CGI_MISSING_FILECONTENT   	-5990
#define _ERROR_CGI_MISSING_FILECONTENT_MSG 	"找不到filecontent"

#define _ERROR_CGI_SHA_NOT_MATCH 			-5984
#define _ERROR_CGI_SHA_NOT_MATCH_MSG 	 	"sha1不匹配"

#define _ERROR_CGI_WRONG_SESSION            -5983
#define _ERROR_CGI_WRONG_SESSION_MSG 	 	"错误的session"

#define _ERROR_CGI_PARAM_OP 				-5980
#define _ERROR_CGI_PARAM_OP_MSG	  			"获取op失败"

#define _ERROR_CGI_PARAM_SHA 				-5979
#define _ERROR_CGI_PARAM_SHA_MSG 			"缺少参数:sha"

#define _ERROR_CGI_REQ_PARAM_FLAG_NOTMATCH     -5976
#define _ERROR_CGI_REQ_PARAM_FLAG_NOTMATCH_MSG "bucket flag与实际参数不一致"

#define _ERROR_CGI_VIDEO_FORMAT             -5974
#define _ERROR_CGI_VIDEO_FORMAT_MSG         "视频码率错误"

#define _ERROR_CGI_CROSS_BUCKET_COPY 		-5973
#define _ERROR_CGI_CROSS_BUCKET_COPY_MSG  	"不允许跨存储空间复制"

#import <Foundation/Foundation.h>

@interface TXYRespErrorParse : NSObject

+ (NSString *)errorMessageForid:(NSUInteger)err_code;
+ (BOOL)checkDataOK:(NSUInteger)error_code;
@end
